package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;

/**
 * @author Jason Biao
 * 
 * 网约车平台公司经营许可接口
 */
@Entity
public class BaseInfoCompanyPermit extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -6189019334617958785L;

	private int address;

	private String certificate;

	private String operationArea;

	private String ownerName;

	private String organization;

	private int startDate;

	private int stopDate;

	private int certifyDate;

	private String state;

	public int getAddress() {
		return address;
	}

	public void setAddress(int address) {
		this.address = address;
	}

	public String getCertificate() {
		return certificate;
	}

	public void setCertificate(String certificate) {
		this.certificate = certificate;
	}

	public String getOperationArea() {
		return operationArea;
	}

	public void setOperationArea(String operationArea) {
		this.operationArea = operationArea;
	}

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String ownerName) {
		this.ownerName = ownerName;
	}

	public String getOrganization() {
		return organization;
	}

	public void setOrganization(String organization) {
		this.organization = organization;
	}

	public int getStartDate() {
		return startDate;
	}

	public void setStartDate(int startDate) {
		this.startDate = startDate;
	}

	public int getStopDate() {
		return stopDate;
	}

	public void setStopDate(int stopDate) {
		this.stopDate = stopDate;
	}

	public int getCertifyDate() {
		return certifyDate;
	}

	public void setCertifyDate(int certifyDate) {
		this.certifyDate = certifyDate;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	 public static OTIpcDef.BaseInfoCompanyPermit convert(BaseInfoCompanyPermit data){
	        OTIpcDef.BaseInfoCompanyPermit item = OTIpcDef.BaseInfoCompanyPermit.newBuilder()
	                .setCompanyId(data.getCompanyId())
	                .setAddress(data.getAddress())
	                .setCertificate(data.getCertificate())
	                .setOperationArea(data.getOperationArea())
	                .setOwnerName(data.getOwnerName())
	                .setOrganization(data.getOrganization())
	                .setStartDate(Long.valueOf(data.getStartDate()))
	                .setStopDate(Long.valueOf(data.getStopDate()))
	                .setCertifyDate(Long.valueOf(data.getCertifyDate()))
	                .setState(data.getState())
	                .setFlag(data.getFlag())
	                .setUpdateTime(Long.valueOf(data.getUpdateTime()))
	                .build();

	        return item;
	    }
	 
	 
	 public static  BaseInfoCompanyPermit convertPojo(OTIpcDef.BaseInfoCompanyPermit data){
		 BaseInfoCompanyPermit bicp=new BaseInfoCompanyPermit();
		 bicp.setAddress(data.getAddress());
		 bicp.setCertificate(data.getCertificate());
		 bicp.setCertifyDate((int)data.getCertifyDate());
		 bicp.setCompanyId(data.getCompanyId());
		 bicp.setFlag(data.getFlag());
		 bicp.setOperationArea(data.getOperationArea());
		 bicp.setOrganization(data.getOrganization());
		 bicp.setOwnerName(data.getOwnerName());
	     bicp.setStartDate((int)data.getStartDate()); 
	     bicp.setState(data.getState());
	     bicp.setStopDate((int)data.getStopDate());
	     bicp.setUpdateTime(data.getUpdateTime());
	 
	     return bicp;
	 }
	 
	 
}
